<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Insert title here</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="tempo/tempo-2.0.js" type="text/javascript"></script>
<script src="jquery/jquery-1.8.3.js" type="text/javascript"></script>
<script>
  $(document).ready(function() {
    var educations = [
      {index:1,order:1,startDate:201201,endDate:201207,msg:"1",isOversea:"y"},
      {index:2,order:12,startDate:201208,endDate:201212,msg:"2",isOversea:"n"},
      {index:3,order:13,startDate:201301,endDate:201307,msg:"3",isOversea:"y"}
    ];
    var educations2 = [
                      {index:4,order:14,startDate:201301,endDate:201307}
                    ];
    var list = $('#cv_education_list');
    var abc = Tempo.prepare(list);
    abc.render(educations);
    //abc.append(educations2);
    //abc.append(educations2);
  });
  function eq(x, y) {
	  console.log("x=" + x + ",y=" + y);
	  return x == y;
  }
  function chk(id, value) {
	try {
    console.log("chk(" + id + "," + value + ")");
    $(id).each(function() {
        if ($(this).attr("value") == value) {
            $(this).attr("checked");
        }
    });
	} catch(e) {console.log(e);}
  }
</script>
</head>
<body>

<% int h1 = 1; %>
<c:set var="h1" value="2"/>
<p><c:out value="${h1}"/></p>

<div id="cv_education_list" class="controls">
	<div id="a1" data-before-template='data-before-template'></div>
	<div id="a2" data-before-template='data-before-template'></div>
	<div id="b1" data-after-template='data-before-template'></div>
	<div id="a3" data-before-template='data-before-template'></div>

<div id="cv_education_cur_{{_tempo.index}}" data-template >
  <label for="cv_education_{{index}}" class="control-label">Hello-{{index}}</label>
  <br>
  <input type="hidden" id="cv_education_{{index}}" name="cvEducation[{{index}}].order" value="{{order}}" class="input-large"/>
  <p>{% if index == ${h1} %}hello{% endif %}</p>
  <p>{% if (msg == "${h1}") %}world{% endif %}</p>
  <div class="row">
      <div class="span12"><div class="control-group">
          <label for="cv_education_{{index}}_isOversea" class="control-label">222</label>
          <div class="controls">
              <input type="radio" id="curCvLang_cvEducation_{{index}}_isOversea" name="curCvLang.cvEducation[{{index}}].isOversea" value="y">&nbsp;&nbsp;Yes&nbsp;&nbsp;
              <input type="radio" id="curCvLang_cvEducation_{{index}}_isOversea" name="curCvLang.cvEducation[{{index}}].isOversea" value="n">&nbsp;&nbsp;No&nbsp;&nbsp;
          </div>
          <select id="x" value="{{index}}">
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
          </select>
      </div></div>
  </div>
  <br>
</div>

</div>
</body>
</html>
